const state = {
    tagList: [
        {name:'首页',path:'/welcome'}
    ]

}
const mutations = {
    SET_MENU(state, val) {
        console.log('setmenu', val)
        if (state.tagList.findIndex(item => item.name == val.name) == -1) {
            if (val.paht != '/' && val.path != '/welcome') {
                state.tagList.push({
                    name: val.name,
                    path: val.path
                })
            }
        }

    },
    CLOSE_TAG(state,val){
        let tagIndex = state.tagList.findIndex((item)=>item.name == val.name)
        state.tagList.splice(tagIndex,1) 
    }
}
const actions = {
}

export default {
    namespaced: true,
    state,
    actions,
    mutations,

}